package com.ruoyi.znjc.mapper;

import java.util.List;
import java.util.Map;

import com.ruoyi.system.domain.PestDisease2;
import com.ruoyi.znjc.domain.ZnjcRuleswarnlog;
import org.apache.ibatis.annotations.MapKey;

/**
 * 规则预警日志Mapper接口
 * 
 * @author ZNJC
 * @date 2025-07-23
 */
public interface ZnjcRuleswarnlogMapper 
{


    Long selectUsersubIdByTimerId(Long timerId);

    Long selectRuleIdByUsersubId(Long usersubId);

    String selectRuleContentByRuleId(Long ruleId);

    int insertRuleswarnlogDirect(ZnjcRuleswarnlog znjcRuleswarnlog);

    /**
     * 查询规则预警日志
     * 
     * @param logId 规则预警日志主键
     * @return 规则预警日志
     */
    public ZnjcRuleswarnlog selectZnjcRuleswarnlogByLogId(Long logId);

    /**
     * 查询规则预警日志列表
     * 
     * @param znjcRuleswarnlog 规则预警日志
     * @return 规则预警日志集合
     */
    public List<ZnjcRuleswarnlog> selectZnjcRuleswarnlogList(ZnjcRuleswarnlog znjcRuleswarnlog);

    /**
     * 新增规则预警日志
     * 
     * @param znjcRuleswarnlog 规则预警日志
     * @return 结果
     */
    public int insertZnjcRuleswarnlog(ZnjcRuleswarnlog znjcRuleswarnlog);

    /**
     * 修改规则预警日志
     * 
     * @param znjcRuleswarnlog 规则预警日志
     * @return 结果
     */
    public int updateZnjcRuleswarnlog(ZnjcRuleswarnlog znjcRuleswarnlog);

    /**
     * 删除规则预警日志
     * 
     * @param logId 规则预警日志主键
     * @return 结果
     */
    public int deleteZnjcRuleswarnlogByLogId(Long logId);

    /**
     * 批量删除规则预警日志
     * 
     * @param logIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteZnjcRuleswarnlogByLogIds(Long[] logIds);

    /**
     * 联表查询病虫害及其对应作物类别名称列表
     * @param pestDisease 传入的筛选条件
     * @return 病虫害列表（带作物类别名称）
     */
    @MapKey("")
    List<Map<String, Object>> selectPestDiseaseWithCategoryName(PestDisease2 pestDisease);
}
